/*
 *   Copyright 1999-2016 Asiainfo Technologies(China),Inc.
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 *
 */

package com.asiainfo.redis.entity;

import org.apache.commons.lang.builder.ReflectionToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * @version v 1.0 on 2016/3/3 15:52
 * @auther william.xu
 */

@Entity
@Table(name="REDIS_CLUSTER_NODE_CONFIG")
@SequenceGenerator(name="REDIS_CLUSTER_NODE_CONFIG_SEQ_",sequenceName="REDIS_CLUSTER_NODE_CONFIG_SEQ",allocationSize=1)
public class ClusterNodeConfig {

    @Id
    @GeneratedValue(strategy=GenerationType.SEQUENCE,generator="REDIS_CLUSTER_NODE_CONFIG_SEQ_")
    @Column(name = "ID")
    private Long id;

    @Column(name = "CLUSTER_ID")
    private Long clusterId;

    @Column(name = "TCP_BACKLOG")
    private Integer tcpBackLog;

    @Column(name = "TIMEOUT")
    private Integer timeout;

    @Column(name = "TCP_KEEPALIVE")
    private Integer tcpKeepalive;

    @Column(name = "LOGLEVEL")
    private String logLevel;

    @Column(name = "MAXCLIENTS")
    private Integer maxClients;

    @Column(name = "MAXMEMORY")
    private Integer maxMemory;

    @Column(name = "MAXMEMORY_POLICY")
    private String maxMemoryPolicy;

    @Column(name = "APPENDONLY")
    private String appendOnly;

    @Column(name = "APPENDONLY_NO_SECONDS")
    private Integer appendOnlyNoSeconds;

    @Column(name = "APPENDONLY_NO_KEYS")
    private Integer appendOnlyNoKeys;

    @Column(name = "APPENDFSYNC")
    private String appendFsync;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getClusterId() {
        return clusterId;
    }

    public void setClusterId(Long clusterId) {
        this.clusterId = clusterId;
    }

    public Integer getTcpBackLog() {
        return tcpBackLog;
    }

    public void setTcpBackLog(Integer tcpBackLog) {
        this.tcpBackLog = tcpBackLog;
    }

    public Integer getTimeout() {
        return timeout;
    }

    public void setTimeout(Integer timeout) {
        this.timeout = timeout;
    }

    public Integer getTcpKeepalive() {
        return tcpKeepalive;
    }

    public void setTcpKeepalive(Integer tcpKeepalive) {
        this.tcpKeepalive = tcpKeepalive;
    }

    public String getLogLevel() {
        return logLevel;
    }

    public void setLogLevel(String logLevel) {
        this.logLevel = logLevel;
    }

    public Integer getMaxClients() {
        return maxClients;
    }

    public void setMaxClients(Integer maxClients) {
        this.maxClients = maxClients;
    }

    public Integer getMaxMemory() {
        return maxMemory;
    }

    public void setMaxMemory(Integer maxMemory) {
        this.maxMemory = maxMemory;
    }

    public String getMaxMemoryPolicy() {
        return maxMemoryPolicy;
    }

    public void setMaxMemoryPolicy(String maxMemoryPolicy) {
        this.maxMemoryPolicy = maxMemoryPolicy;
    }

    public String getAppendOnly() {
        return appendOnly;
    }

    public void setAppendOnly(String appendOnly) {
        this.appendOnly = appendOnly;
    }

    public Integer getAppendOnlyNoSeconds() {
        return appendOnlyNoSeconds;
    }

    public void setAppendOnlyNoSeconds(Integer appendOnlyNoSeconds) {
        this.appendOnlyNoSeconds = appendOnlyNoSeconds;
    }

    public Integer getAppendOnlyNoKeys() {
        return appendOnlyNoKeys;
    }

    public void setAppendOnlyNoKeys(Integer appendOnlyNoKeys) {
        this.appendOnlyNoKeys = appendOnlyNoKeys;
    }

    public String getAppendFsync() {
        return appendFsync;
    }

    public void setAppendFsync(String appendFsync) {
        this.appendFsync = appendFsync;
    }

    public String toString(){
        return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE);
    }

}
